home *** CD-ROM | disk | FTP | other *** search
- Path: news.nask.org.pl!usenet
- From: flssoft@blue.maloka.waw.pl (Grzegorz (FLS))
- Newsgroups: comp.lang.c++
- Subject: Re: A question about serialization and MFC in VC++.
- Date: Wed, 27 Mar 1996 19:12:24 GMT
- Organization: Research and Academic Computer Network
- Message-ID: <4jc3qe$s35@bilbo.nask.org.pl>
- NNTP-Posting-Host: s114.maloka.waw.pl
- X-Newsreader: Forte Free Agent v0.46
-
- > MyClass *ptr;
-
- > ptr=new MyClass();
-
- > ptr->Serialize();
-
- >But this only gets the first record. I can't seem to get feof to work
- >with the CArchive class (as in: while(!(feof(ar)) ).
-
-
- Hi,
-
- This is good idea to write before MyClass serialization the number of
- elements of MyClass type. For example for CString class, the
- serialization saves the number of characters first, and thereafter
- this characters. If you wish to save n objects of MyClass elements,
- do:
-
- ar << number_of_MyClass_elements ;
- for each object do
- ar << objectOfMyClass
-
- If you save your objects in the list of CObList type, the
- serialization fo CObList class will do it itself.
-
- Grzegorz
-
- ``````````````````````````` Grzes vel Pysiak
- Ablue, pecte canem, canis est et permanet idem.
- Desunt cetera!
-
-